package lesson6.example2;

import java.util.concurrent.ExecutorService;

public class ThreadPoolParam implements ThreadPoolParamMBean  {
    private ThreadPoolMonitor threadPoolMonitor;
 
    public ThreadPoolParam(ExecutorService es) {
        this.threadPoolMonitor = (ThreadPoolMonitor) es;
    }
 
    @Override
    public int getActiveCount() {
        return threadPoolMonitor.getAc();
    }
 
    @Override
    public long getCompletedTaskCount() {
        return threadPoolMonitor.getCompletedTaskCount();
    }
 
    @Override
    public int getCorePoolSize() {
        return threadPoolMonitor.getCorePoolSize();
    }
 
    @Override
    public int getLargestPoolSize() {
        return threadPoolMonitor.getLargestPoolSize();
    }
 
    @Override
    public int getMaximumPoolSize() {
        return threadPoolMonitor.getMaximumPoolSize();
    }
 
    @Override
    public int getPoolSize() {
        return threadPoolMonitor.getPoolSize();
    }
 
    @Override
    public long getTaskCount() {
        return threadPoolMonitor.getTaskCount();
    }
 
    @Override
    public long getMaxCostTime() {
        return threadPoolMonitor.getMaxCostTime();
    }
 
    @Override
    public long getMinCostTime() {
        return threadPoolMonitor.getMinCostTime();
    }
 
    @Override
    public float getAverageCostTime() {
        return threadPoolMonitor.getAverageCostTime();
    }
}
